package com.example.demo.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("yml")
@RestController
public class ReadymlController {
    @Value("${mykey.key1}")
    private String key;

    @RequestMapping("/readyml")
    public String readYml() {
        return "从yml中获取配置文件"+ key;
    }
}
